//typedef unsigned char u8;
//typedef unsigned short u16;
//typedef unsigned long u32;
//define some video registers/values
#define REG_DISPCNT *(u32*)0x4000000
#define BG2_ENABLE 0x400
#define SetMode(mode) REG_DISPCNT = (mode)
//define some interrupt registers
#define REG_IME *(u16*)0x4000208
#define REG_IE *(u16*)0x4000200
#define REG_IF *(u16*)0x4000202
#define REG_INTERRUPT *(u32*)0x3007FFC
#define REG_DISPSTAT *(u16*)0x4000004
#define INT_VBLANK 0x0001
//define some timer and DMA registers/values
#define REG_TM0D *(volatile u16*)0x4000100
#define REG_TM0CNT *(volatile u16*)0x4000102
#define REG_DMA1SAD *(volatile u32*)0x40000BC
#define REG_DMA1DAD *(volatile u32*)0x40000C0
#define REG_DMA1CNT_H *(volatile u16*)0x40000C6
#define TIMER_ENABLE 0x80
#define DMA_DEST_FIXED 64
#define DMA_REPEAT 512
#define DMA_32 1024
#define DMA_ENABLE 32768
#define DMA_TIMING_SYNC_TO_DISPLAY 4096 | 8192

//define some sound hardware registers/values

#define REG_SGCNT0_H *(volatile u16*)0x4000082
#define REG_SGCNT1 *(volatile u16*)0x4000084
#define DSOUND_A_RIGHT_CHANNEL 256
#define DSOUND_A_LEFT_CHANNEL 512
#define DSOUND_A_FIFO_RESET 2048
#define SOUND_MASTER_ENABLE 128
